package com.jzlin.funhub.admin.service.article;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jzlin.funhub.admin.mapper.ArticleCommentRepliesMapper;
import com.jzlin.funhub.admin.model.entity.ArticleCommentReplies;
import com.jzlin.funhub.admin.model.req.ArticleCommentReplyPublishReq;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 文章评论回复表 服务实现类
 * </p>
 *
 * @author jzlin
 * @since 2025-08-22
 */
@Service
public class ArticleCommentRepliesService extends ServiceImpl<ArticleCommentRepliesMapper, ArticleCommentReplies> {

    /**
     * 发布文章评论回复
     *
     * @param req
     */
    public Long publishCommentReply(ArticleCommentReplyPublishReq req) {
        ArticleCommentReplies reply = new ArticleCommentReplies();
        reply.setSourceCommentId(req.getSourceCommentId());
        reply.setContent(req.getContent());
        reply.setParentReplyId(req.getParentReplyId());
        reply.setRepliedUserId(req.getRepliedUserId());

        save(reply);
        return reply.getId();
    }
}
